CPP = g++
CFLAGS = -Wall
LFLAGS = -lm


.PHONY: all test clean

all: statistic 

statistic:statistic.o array.o
	$(CPP) $(LFLAGS) -o $@ $^

statistic.o:statistic.cpp array.hpp
	$(CPP) -c $(CFLAGS) -o $@ $<

array.o:array.cpp array.hpp
	$(CPP) -c $(CFLAGS) -o $@ $<


test:tests
	./tests

tests:tests.o array.o
	$(CPP) $(LFLAGS) -o $@ $^

tests.o:tests.cpp array.hpp
	$(CPP) -c $(CFLAGS) -o $@ $<

clean:
	rm -f statistic tests
	rm -f *.o
